package com.yc.java_basic2;

public class Test2 {
	public static void main(String[] args) {
		//5
		int num5 = 90;
		for(int i = 2; i <= num5; ) {
			//能不能被整除
			if( num5 % i == 0 ) {
				//i就是质因数
				System.out.println( i );
				num5 /= i;
			}else {
				i++;
			}
		}
		
		//6
		for(int i = 1; i <= 1000; i++) {
			int sum6 = 0;
			for(int j = 1; j < i; j++) {
				if( i % j == 0 ) {
					sum6 += j;
				}
			}
			//是否相等
			if( sum6 == i ) {
				System.out.println( i + "是完数" );
			}
		}
		
		//7
		int sum7 = 0;
		int a = 1;
		int b = 1;
		sum7 = a + b;
		for(int i = 3; i <= 20; i++) {
			int c = a + b;
			
			sum7 += c;
			a = b;
			b = c;
			
		}
		
		System.out.println( sum7 ); 
		
		
		//8
		int num8 = 60006;
		int wan = num8 / 10000;
		int qian = num8 % 10000 / 1000;
		int bai = num8 % 1000 / 100;
		int shi = num8 % 100 / 10;
		int ge = num8 % 10;
		if( wan == ge  && qian == shi ) {
			System.out.println(num8 + "是回文数");
		}else {
			System.out.println(num8 + "不是回文数");
		}
	}
}
